package com.welab.springcloud.demo.api;

import com.welab.springcloud.demo.api.fallback.GoodsApiFallback;
import com.welab.springcloud.demo.dto.Goods;
import com.welab.springcloud.demo.dto.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(value = "GOODS-SERVICE", fallback = GoodsApiFallback.class)
public interface GoodsApi {

	@RequestMapping(value = "/getGoods/{goodsId}")
	ResponseResult<Goods> getGoods(@PathVariable("goodsId") String goodsId);

	@GetMapping(value = "/userGoods/{userId}")
	ResponseResult<List<Goods>> userGoods(@PathVariable("userId") Integer userId);
	
}
